let router = require('express').Router()

let { getopenList,
    getchatcontent,
    sendMsg,
    removeUnread,
    changeChatState,
    getFriendgroupList,
    getFriendList,
    addChatRecord,
    searchFriend,
    addfriend,
    getapplicationlist,
    approval,
    changeApplicationState,
    checkApplication,
    changeFriendNotes,
    changeGroup
} = require('../controller/message')
let { testToken } = require('../middleware/users')
// 获取聊天记录列表
router.get('/msglist', testToken, getopenList)
// 获取聊天信息
router.get('/chatcn', testToken, getchatcontent)
// 发送消息
router.post('/sendmsg', testToken, sendMsg)
// 打开聊天 去除未读
router.post('/removeun', testToken, removeUnread)
// 设置聊天打开的状态
router.post('/changechatctate', testToken, changeChatState)
// 获取好友分组列表
router.get('/friendgroup', testToken, getFriendgroupList)
// 获取好友列表
router.post('/friend', testToken, getFriendList)
// 双击好友或者点击发消息 跳到聊天记录 需要添加聊天记录
router.put('/addchatrecord', testToken, addChatRecord)
// 搜索好友
router.post('/searchfriend', testToken, searchFriend)
// // 添加好友
router.put('/addfriend', testToken, addfriend)
// 获取好友申请信息列表
router.post('/applicationlist', testToken, getapplicationlist)
// 审批好友申请
router.put('/approval', testToken, approval)
//  改变好友申请的阅读状态
router.post('/changeApplicationState', testToken, changeApplicationState)
// 判断用户好友申请信息页面是否打开
router.post('/checkApplication', testToken, checkApplication)
// 修改好友备注
router.post('/changeFriendNotes', testToken, changeFriendNotes)
// 改变好友的分组
router.post('/changeGroup', testToken, changeGroup)
module.exports = router